package com.dtstack.mongodb.domain.document;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

/**
 * ArticleDocument
 *
 * <p>
 *     文章document
 * </p>
 *
 * @author chuanbai
 * @date 2024/10/18
 */
@Document(collection = "articles")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ArticleDocument {

    // 使用自定义的主键类型
    @Id
//    private ObjectId id;
    private Long id;

    // 作者
    @Field(value = "author")
    private String author;

    // 性别
    @Field(value = "sex")
    private Integer sex;

    // 评论
    @Field(value = "comment")
    private String comment;


}
